

<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<meta name="format-detection" content="telephone=no">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="mobile-web-app-capable" content="yes">
	<meta name="msapplication-tap-highlight" content="no">
	<script type="text/javascript" src="<%=commonPath %>/pageRc/js/jquery-1.9.1.min.js"></script> 
 　	<link rel="stylesheet" href="<%=commonPath %>/pageRc/layui/css/layui.css" media="all">
 　　　<script type="text/javascript" src="<%=commonPath %>/pageRc/common/utils.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/common/msgTool.js"></script>
	<script type="text/javascript" src="<%=commonPath %>/pageRc/layui/layui.js"></script>　
	<title>新增需求信息</title> 
	<script type="text/javascript">　
	var path = "<%=commonPath%>";
	var msg =new msgTool(); 　
 
	</script>
</head>

 <body style="layui-main">
	 <div class="header">
	  <div class="main">
	    <div class="nav">
	      <blockquote class="layui-elem-quote">hi, ${userBean.userName} ，你好！</blockquote>   
	    </div> 
	  </div>
	</div>
             <form  id="createMsgForm" name="createMsgForm"  class="layui-form"  style="padding:1.5rem"  >
               <div class="layui-form-item">
                 <label class="layui-form-label">所属项目组</label>
	              <div class="layui-input-block"> 
	                  <input id="proTeamNo"  name = "proTeamNo"  value="${userBean.proTeamNo}"  type="hidden">
	                  <input id="proTeamName"  name = "proTeamName"  value="${userBean.proTeamName}"  class="layui-input" disabled>
 	              </div>
               </div>
               <div class="layui-form-item">
                 <label class="layui-form-label">需求编号</label>
	              <div class="layui-input-block"> 
	                  <input id="needNo"  name = "needNo"    class="layui-input"  placeholder="请输入需求编号"    required lay-verify="required" autocomplete="off" >
 	              </div>
               </div>
               <div class="layui-form-item">
                <label  class="layui-form-label">需求名称</label>
                <div class="layui-input-block">
                    <input type="text" id="needName"  name="needName"  placeholder="请输入需求名称"   name="userName" required lay-verify="required" autocomplete="off" class="layui-input">
                </div>
              </div>   
               <div class="layui-form-item"> 
                <label  class="layui-form-label">人月 </label> 
                <div class="layui-input-block">
                  <input type="number" id="renyue" name="renyue" value=""  placeholder="请输入人月"   required lay-verify="required" autocomplete="off" class="layui-input" onchange="getneedTime()">
                 </div>
              </div>  
              
              <div class="layui-form-item"> 
                <label  class="layui-form-label">评估工时  </label> 
                <div class="layui-input-block">
                  <input type="number" id="needTime" name="needTime" value=""  placeholder="按小时填写"   required lay-verify="required" autocomplete="off" class="layui-input" onchange="getrenyue()">
                 </div>
              </div>   
              
               <div class="layui-form-item"> 
		      <label class="layui-form-label">当前阶段 </label>
		       <div class="layui-input-inline">
					<select name="now_Stage" id="now_Stage"  style="width: 210;">
						<option value="10">需求酝酿</option>
						<option value="01">需求分析</option>
						<option value="11">需求确认</option>
						<option value="02">需求评审</option>
						<option value="03">技术评审</option>
						<option value="04">开发联调</option>
						<option value="05">SIT测试</option>
						<option value="06">UAT测试</option>
						<option value="07">需求上线</option>
						<option value="08">回顾总结</option>
					</select>
				</div>
              </div>  
              
              <div class="layui-form-item">
			<label class="layui-form-label">合同号</label>
			<div class="layui-input-block">
				<input id="contractId" name="contractId" class="layui-input"
					placeholder="请输入合同号" value=""
					 autocomplete="off">
			</div>
		</div> 
		
		  <div class="layui-form-item">
			<label class="layui-form-label">产品编号</label>
			<div class="layui-input-block">
				<input id="contractNo" name="contractNo" class="layui-input"
					placeholder="请输入产品编号" value="" 
					 autocomplete="off">
			</div>
		</div> 
              
              
              <!-- <div class="layui-form-item">
			<label class="layui-form-label">合同号</label>
			<div class="layui-input-block">
				<input id="contractId" name="contractId" class="layui-input"
					placeholder="请输入合同号" value="" disabled="true"
					 autocomplete="off">
			</div>
		</div>  -->
		
              <!--  <div class="layui-form-item">
			<label class="layui-form-label">产品编号</label>
			<div class="layui-input-block">
				<input id="contractNo" name="contractNo" class="layui-input"
					placeholder="请输入产品编号" value="" onblur="getContractId()"
					 autocomplete="off">
			</div>
		</div>  -->

		<div class="layui-form-item">
			<label class="layui-form-label">需求酝酿</label>
			<div class="layui-input-block">
				<input class="layui-input" id="need_Brewing" name="need_Brewing"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="需求酝酿日期" autocomplete="off" required lay-verify="required">
			</div>
		</div> 
		<div class="layui-form-item">
			<label class="layui-form-label">需求分析</label>
			<div class="layui-input-block">
				<input class="layui-input" id="need_Analysis" name="need_Analysis"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="需求分析日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">需求确认</label>
			<div class="layui-input-block">
				<input class="layui-input" id="need_Confirm" name="need_Confirm"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="需求确认日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">需求评审</label>
			<div class="layui-input-block">
				<input class="layui-input" id="need_Review" name="need_Review"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="需求评审日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">技术评审</label>
			<div class="layui-input-block">
				<input class="layui-input" id="technical_Review" name="technical_Review"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="技术评审日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">开发联调</label>
			<div class="layui-input-block">
				<input class="layui-input" id="develop_Joint" name="develop_Joint"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="开发联调日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">SIT测试</label>
			<div class="layui-input-block">
				<input class="layui-input" id="sit_Test" name="sit_Test"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="SIT测试日期" autocomplete="off" >
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">UAT测试</label>
			<div class="layui-input-block">
				<input class="layui-input" id="uat_Test" name="uat_Test"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="UAT测试日期" autocomplete="off">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">需求上线</label>
			<div class="layui-input-block">
				<input class="layui-input" id="need_Online" name="need_Online"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="需求上线日期" autocomplete="off">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">回顾总结</label>
			<div class="layui-input-block">
				<input class="layui-input" id="back_Review" name="back_Review"
							value="${sysdate}"
							onclick="layui.laydate({elem: this, istime: true, format: 'YYYYMMDD'})"
							placeholder="回顾总结日期" autocomplete="off">
			</div>
		</div>
              <div class="layui-form-item">
	              <div class="layui-input-block">
	              	 <button class="layui-btn" lay-filter="submitData" lay-submit>提交</button>
    	              </div>
              </div>  
          </form> 
<script> 
  layui.use(
		[ 'form', 'layer', 'laytpl', 'laypage','laydate' ],
		 function(){
			var form = layui.form(),
			layer = layui.layer;
			form.on('submit(submitData)',function(data){
				var field = data.field;
				if(field.back_Review>=field.need_Online||field.back_Review==""){
				if(field.needTime<=80){
					   layer.confirm("你确定你的评估工时的单位是小时吗？如果不是请点击取消。",{icon:3,title:"提示"},function(index){
						   msg.sendMsg("/page/need/addNeedInfor.do",field,function(data){ //新加的微信登录入口
								alert("提交成功！,请尽快联系团队经理进行审核。");
								location.href ="<%=commonPath %>/page/base/dologin.do";
							}); 
					   }); 
				}else{
					layer.confirm("请确定人月和评估工时是否正确？如果不是请点击取消。",{icon:3,title:"提示"},function(index){
					 msg.sendMsg("/page/need/addNeedInfor.do",field,function(data){ //新加的微信登录入口
							alert("提交成功！,请尽快联系团队经理进行审核。");
							location.href ="<%=commonPath %>/page/base/dologin.do";
						}); 
					});
				}
				return false;
			}
			alert("回顾总结时间要在上线后面")
			return false;
 				
			});
			    
	       
	
});
  
  function getneedTime(){
      var num1 = document.getElementById('renyue').value; //获取第一个输入框的值
      if (isNaN(num1)) {  //如果为非数字，结果为空
          document.getElementById('needTime').value = "";
      } else {  //将第二个输入框设置为工时的结果
          document.getElementById('needTime').value = num1*22*8;
      }
  } 
  
  
  function getrenyue(){
      var num1 = document.getElementById('needTime').value; //获取第一个输入框的值
      if (isNaN(num1)) {  //如果为非数字，结果为空
          document.getElementById('renyue').value = "";
      } else {  //将第二个输入框设置为人月的结果
          document.getElementById('renyue').value = num1/22/8;
      }
  } 
  
  function getContractId(){
      var contractNo = document.getElementById('contractNo').value; //获取第一个输入框的值
      if(contractNo == '' || contractNo == null){
    	  layer.alert("请填写产品编号！");
      }else{
    	  $.ajax({
    	  		type:'POST',
    	  		url:'<%=commonPath %>/page/contract/selectContractIdByContractNo.do?contractNo='+contractNo,
    	  		dataType:'JSON',
    	  		success:function(data){
    	  			var contractId = data.body.contractId;
   	  				if(contractId == '' || contractId == null){
   	  					layer.alert("没有匹配的合同号！");
   	  				}else{
   	  					document.getElementById('contractId').value = contractId;
   	  				}
    	  		}
    	  	})
      }
  }
 /*  $('#need_Confirm').focus(function(){
		var num1 = document.getElementById('need_Analysis').value; //获取第一个输入框的值
		var num2 = document.getElementById('need_Brewing').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("需求分析不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("分析时间必须在酝酿时间后面")
	    	  $(this).blur();
	      }
		});
	$('#need_Review').focus(function(){
		var num1 = document.getElementById('need_Confirm').value; //获取第一个输入框的值
		var num2 = document.getElementById('need_Analysis').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("需求确认不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("确认时间必须在分析时间后面")
	    	  $(this).blur();
	      }
		});
	$('#technical_Review').focus(function(){
		var num1 = document.getElementById('need_Review').value; //获取第一个输入框的值
		var num2 = document.getElementById('need_Confirm').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("需求评审不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("评审时间必须在确认时间后面")
	    	  $(this).blur();
	      }
		});
	$('#develop_Joint').focus(function(){
		var num1 = document.getElementById('technical_Review').value; //获取第一个输入框的值
		var num2 = document.getElementById('need_Review').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("技术评审不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("技术评审时间必须在需求评审时间后面")
	    	  $(this).blur();
	      }
		});
	$('#sit_Test').focus(function(){
		var num1 = document.getElementById('develop_Joint').value; //获取第一个输入框的值
		var num2 = document.getElementById('technical_Review').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("开发联调不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("联调时间必须在技术评审时间后面")
	    	  $(this).blur();
	      }
		});
	$('#uat_Test').focus(function(){
		var num1 = document.getElementById('sit_Test').value; //获取第一个输入框的值
		var num2 = document.getElementById('develop_Joint').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("sit测试不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("sit时间必须在联调时间后面")
	    	  $(this).blur();
	      }
		});
	$('#need_Online').focus(function(){
		var num1 = document.getElementById('uat_Test').value; //获取第一个输入框的值
		var num2 = document.getElementById('sit_Test').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("uat测试不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("uat时间必须在sit时间后面")
	    	  $(this).blur();
	      }
		});
	$('#back_Review').focus(function(){
		var num1 = document.getElementById('need_Online').value; //获取第一个输入框的值
		var num2 = document.getElementById('uat_Test').value; //获取第一个输入框的值
	      if (num1=="") {  
	          alert("上线不能为空")
	          $(this).blur();
	      } else  if(num1>=num2){
	         
	      }else{
	    	  alert("上线时间必须在uat时间后面")
	    	  $(this).blur();
	      }
		}); */
  
</script>
</body>
</html>
 
 